package com.github.cyf.cacheManager.impl;

import com.github.cyf.cacheManager.AbstractCacheManager;
import com.github.cyf.cacheManager.CacheNameEnum;
import com.github.cyf.common.util.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author chenyifan
 * @create 2025-02-10 13:20
 */
@Component
public class SysConfigCacheManger extends AbstractCacheManager {

    @Autowired
    private RedisUtil redisUtil;

    @Override
    protected void loadCache() {
        redisUtil.set("sys:key1", "value1", 30);
        redisUtil.set("sys:key2", "value2", 30);
    }

    @Override
    public CacheNameEnum getCacheName() {
        return CacheNameEnum.SYS_CONFIG;
    }

    @Override
    public String getCronExpression() {
        return "0/15 * * * * ?";
    }
}